package StudyCode.summary.mycollection;

import java.util.ArrayList;
import java.util.List;

/**
 * 版权所有 科技与人文(www.tah1986.com)
 */
public class CreatesANewListFromTheIterableElements {
	public static <T> List<T> toList(Iterable<T> iterable) {
		List<T> list = null;

		if (iterable != null) {
			list = new ArrayList<>();
			for (T elem : iterable) {
				list.add(elem);
			}
		}

		return list;
	}
}
